#ifndef __CC1_DET_H__
#define __CC1_DET_H__

#include "cmsis_os2.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief CC1对比的电压值 mv
 */
#define CC1_4V_VOL              846
#define CC1_6V_VOL              1260
#define CC1_12V_VOL             2520
#define CC1_VOL_OFFSET          200     /* 检测误差正负200mv */

#define CC1_CHANNEL             4
#define CC1_REFER_VOLTAGE       330
#define CC1_CONVERT_BITS        (1 << 12)

/**
 * @brief CC1状态
 */
enum
{
    CC1_4V_STATE = 1,
    CC1_6V_STATE,
    CC1_12V_STATE
};

int cc1_det(void);
int get_cc1_state(void);

#ifdef __cplusplus
}
#endif

#endif  /* __INS_DET_H__ */


